import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import 'element-ui/lib/theme-chalk/index.css'
import ElementUI from 'element-ui'
import '@/styles/index.scss' // global css
import i18n from '@/lang'
import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control
import '@/directives'
import UploadImg from '@/components/UploadImg'
Vue.component('UploadImg', UploadImg)

// 全局注册混入
// 全局注册  Vue.mixin(混入的代码)   局部注册 mixins:[混入的代码]
import mixinsCode from '@/utils/mixins'
Vue.mixin(mixinsCode)

// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: (h) => h(App)
})
